package com.huaao.micropolice.core.common.page;

import java.util.List;

public class Page {
	
	private int pageNum = 1; // 当前页开始

	private int pageSize = 10; // 记录每页的数据个数

	private long totalCount; // 总记录数

	private List results;
	
	public int getPageNum() {
		return pageNum;
	}

	public void setPageNum(int pageNum) {
		if(pageNum < 1){
			pageNum = 1;
		}
		this.pageNum = pageNum;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public long getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(long totalCount) {
		this.totalCount = totalCount;
	}

	public List getResults() {
		return results;
	}

	public void setResults(List results) {
		this.results = results;
	}
	
	public int getFirst(){
		return (pageNum-1)*pageSize;
	}
	
	public int getMax(){
		return pageNum*pageSize;
	}
	
	public long getTotalPageNum(){
		return (totalCount+pageSize-1)/pageSize; 
	}
	
}
